#include "mainwindow.h"
#include <QApplication>
MainWindow *cite;
void extern_DrawWork_AddPoint(int x,int y,int z)
{
    cite->DrawWork_AddPoint(x/X_UNIT,y/Y_UNIT,z/Z_UNIT);

}

void extern_DrawPreview_AddPoint(int x,int y,int z)
{
//    qDebug()<<"Get"<<endl;
    cite->DrawPreView_AddPoint((float)x*X_UNIT,(float)y*Y_UNIT,(float)z*Z_UNIT);
//    qDebug()<<"Get"<<endl;
}

void extern_feedspeed_handler(float speed)
{
    cite->feedspeed = speed;
    cite->FeedSpeedValue->setText(QString("%1").arg(speed));
}

void extern_mainshaftSpeed_handler(float speed)
{
    cite->mainshaftSpeed = speed;
    cite->RotationValue->setText(QString("%1").arg(speed));
}

void extern_CoolingControl_handler(int status)
{
    cite->SetStatusSignal(status+10);
}

void extern_mainsharftControl_handler(int status)
{
    cite->SetStatusSignal(status);
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    cite = &w;
    w.show();

    return a.exec();
}
